package org.nox.helloseries.server.services.browser.domain;

import org.nox.helloseries.server.connector.bdd.domain.BrowserCookieTable;

public enum Navigateur
{

    FIREFOX( "firefox", BrowserCookieTable.FIREFOX ), CHROME( "chrome", BrowserCookieTable.CHROME );

    private String value;

    private BrowserCookieTable cookieTable;

    private Navigateur( String value, BrowserCookieTable cookieTable )
    {
        this.value = value;
        this.cookieTable = cookieTable;
    }

    public String getValue()
    {
        return value;
    }

    public static Navigateur fromValue( String value )
    {
        for ( Navigateur nav : values() )
        {
            if ( nav.getValue().equals( value ) )
            {
                return nav;
            }
        }
        throw new IllegalArgumentException( "Valeur non mappée par l'énumération " + value );
    }

    public BrowserCookieTable getBrowserCookieTable()
    {
        return cookieTable;
    }
}
